<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>Document</title>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
</head>
<body>

<!--通用顶部-->
<div id="ios-top-box">
    <div id="header" class="bar bar-nav">
    <div class="titlebar">
    <a href="javascript:appClose('singlelist',api);"><i class="iconfont iconline-arrow-left"></i></a>
    <h1 class="title">晒单-单人抢购</h1>
    </div>
    </div>
</div>
<!--通用顶部结束-->
<header class="bar bar-nav box_shadow head_a" style="margin-top:43px;">
<a href="javascript:randomSwitchBtn('singlelist',api);" style="width:33.3%;" class="selected_bottom">已晒单</a>
<a href="javascript:randomSwitchBtn('singlelister',api);" style="width:33.3%;">未晒单</a>
<a href="javascript:randomSwitchBtn('tsinglelist',api);" style="width:33.3%;">参团晒单</a>
</header>

<section class="notBottom" style="margin-top:100px !important;">
    <div class="scroller create_goods">
        <div class="listsd"></div>
    </div>
</section>

<script type="text/javascript" charset="utf-8">

    var userinfo;
    if(userinfo = getUserinfo()){
        
        apiready = function(){
            api.showProgress({title : '加载中',text : ''});
        
        find_node();
        
        function find_node(){
            var timer = setInterval(function(){
                var sd_ok_id = localData.get('sd_ok_id');
                if(sd_ok_id){
                    clearInterval(timer);
                    GetJPData(config.url+'/app.php?act=singlelist&uid='+userinfo['uid'],{sd_ok_id:sd_ok_id},function(data){
                        var new_html = "";
                        if(data['status'] == 1){
                            new_html += '<ul class="listitem group_listitem">';
                            new_html += '<li style="border-bottom:1px solid #e4e4e4;">';
                            new_html += '<a href="javascript:openItem(\'sddetail\','+data['data']['listItems']['sd_id']+',function(id){localData.set(\'sd_id\',id);});">';
                            new_html += '<img src="'+config.upload_url+'/'+data['data']['listItems']['thumb']+'" width="70" height="70" class="img"/>';
                            new_html += '<div class="text shaidan" style="height:74px;">';
                            new_html += '<p>'+data['data']['listItems']['sd_title']+'</p>';
                            new_html += '<p>'+data['data']['listItems']['sd_content']+'</p>';
                            new_html += '<p>晒单时间：'+data['data']['listItems']['sd_time']+'</p>';
                            new_html += '<p><span style="float:right;">';
                            new_html += '<a href="javascript:openItem(\'sddetail\','+data['data']['listItems']['sd_id']+',function(id){localData.set(\'sd_id\',id);});">';
                            new_html += '</a></span></p></div></a></li></ul>';
                            $('.listsd').before(new_html);
                            $('.newnode').hide();
                            localData.remove('sd_ok_id');
                        }
                        find_node();
                    });
                }
            },1000);
        }
               
    	GetJPData(config.url+'/app.php?act=singlelist&uid='+userinfo['uid'],{},function(data){
    	    api.hideProgress();
    	    var html = "";
    	    if(data['status'] == 1){
    	        for(var i in data['data']['listItems']){
                html += '<ul class="listitem group_listitem">';
                html += '<li style="border-bottom:1px solid #e4e4e4;">';
                html += '<a href="javascript:openItem(\'sddetail\','+data['data']['listItems'][i]['sd_id']+',function(id){localData.set(\'sd_id\',id);});">';
                html += '<img data-original="'+config.upload_url+'/'+data['data']['listItems'][i]['thumb']+'" width="70" height="70" class="lazy img"/>';
                html += '<div class="text shaidan" style="height:74px;">';
                html += '<p>'+data['data']['listItems'][i]['sd_title']+'</p>';
                html += '<p>'+data['data']['listItems'][i]['sd_content']+'</p>';
                html += '<p>晒单时间：'+data['data']['listItems'][i]['sd_time']+'</p>';
                html += '<p><span style="float:right;">';
                html += '<a href="javascript:openItem(\'sddetail\','+data['data']['listItems'][i]['sd_id']+',function(id){localData.set(\'sd_id\',id);});">';
                html += '</a></span></p></div></a></li></ul>';
    	        }
    	        $('.listsd').after(html);
    	        lyzimg();
    	    }else{
    	          html += '<ul class="listitem group_listitem newnode">';
                  html += '<li>';
                  html += '<p style="text-align: center;">暂无记录</p>';
                  html += '</li></ul>';
                  $('.listsd').after(html);
    	    }
    	});
    	
    	        };
	}else{
        $.PageDialog.fail('请登录用户');
    }
</script>
</body>
</html>